home *** CD-ROM | disk | FTP | other *** search
/ BCI NET / BCI NET Dec 94.iso / archives / programming / source / fileselect.lha / FileSelect / FileSelect.doc < prev    next >
Text File  |  1992-05-14  |  11KB  |  239 lines

  1. File-Select Version 2.0
  2. (C) by André Wichmann of CLUSTER in 09/1990.
  3.        Posener Weg 4
  4.        5300 Bonn 1
  5.        West Germany
  6.  
  7. This program is Freeware and may be copied or used even in commercial
  8. programs if you mention the author.
  9.  
  10. -----------------------------------------------------------------------------
  11.  
  12.      - FileSelect V2.0 -
  13.     ~~~~~~~~~~~~~~~~~~~~~
  14.  
  15. Here is another nice request in the never ending series of filerequests, but
  16. this time with some more features.
  17.  
  18. PRO AND CONTRA
  19. ~~~~~~~~~~~~~~~
  20.  
  21.        FileSelect V2.0 pros:
  22.  
  23.               - Displays the sizes of the files, but is small enough to fit
  24.                 on a lo-res screen
  25.               - Fast and small (My opinion!)
  26.               - You can select the colors which should be used (FilePen,
  27.                 DirPen, GadgetPen, BackPen)
  28.               - You can give a list of filters to the request-routine (no
  29.                 .info-files should be shown for example)
  30.               - No limits (Why can some filerequests only show 200 files ?)
  31.               - All is done with structures and an own include-file (for
  32.                 future improvements)
  33.               - Three useful gadgets can optionally be switched on or off:
  34.                 makedir, delete and rename. (I missed them in other requests)
  35.               - You can certainly set a windowtitle, a default path and a
  36.                 default filename (Well, I need not mention that you can put
  37.                 it on any screen-position !)
  38.               - If you do not set a screenpointer FileSelect will use the
  39.                 active screen
  40.               - You will get back the path, the file AND the full name
  41.               - Show devices and double-click are also supported
  42.               - You need no large library (as ARP does)
  43.  
  44.        FileSelect V2.0 contras:
  45.  
  46.               - must be in CHIPMEM because of some images (Will be changed
  47.                 soon!)
  48.  
  49. HOW TO USE IT AS AN USER
  50. ~~~~~~~~~~~~~~~~~~~~~~~~~
  51. You can enter any path in the 'Path'-gadget and FileSelect will try to show
  52. the path when you press return.Use either your mouse to select a file or
  53. directory or type in any filename in the 'File'-gadget.To end the request,
  54. either double-click a filename, click 'Okay' or click 'Cancel'.Click on the
  55. 'Makedir'-gadget to create a new directory (A new request will appear).Enter
  56. a filename and click 'Delete' to delete this (You will be asked if you really
  57. want to delete that file).Enter a filename and click 'Rename' to rename that
  58. file (again with a new request).Sometimes these gadgets are switched off by
  59. the main program so you can't use them.Press the right mouse-button to get a
  60. list of all connected devices (df0:, ram: etc.).
  61.  
  62. HOW TO USE IT AS A PROGRAMMER
  63. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  64.  
  65. This version is written for the DevPac assembler V2.14, but if you use the
  66. linkable file 'FileSelect.o' I think you can use it in any language.
  67. To use it you must include the file 'FileSelect.i' which contains several
  68. structures and important equates.To call FileSelect a0 must contain a pointer
  69. on the following structure:
  70.  
  71. NFS2_NewFileSelect      rs.b    0
  72. NFS2_LeftEdge           rs.w    1
  73. NFS2_TopEdge            rs.w    1
  74. NFS2_WindowTitle        rs.l    1
  75. NFS2_DefaultPath        rs.l    1
  76. NFS2_DefaultFile        rs.l    1
  77. NFS2_Screenptr          rs.l    1
  78. NFS2_GadgetFlags        rs.w    1
  79. NFS2_FirstFilter        rs.l    1
  80. NFS2_BackPen            rs.b    1
  81. NFS2_FilePen            rs.b    1
  82. NFS2_DirPen             rs.b    1
  83. NFS2_GadgetPen          rs.b    1
  84. NFS2_Reserved1          rs.l    1
  85. NFS2_Reserved2          rs.l    1
  86. NFS2_SIZEOF             rs.w    0
  87.  
  88. NFS2_LeftEdge.w         This is the x-position for FileSelect.Use
  89.                         NFS2_CENTREPOS (-1) to centre it on a hires-screen.
  90. NFS2_TopEdge.w          This is the y-position for FileSelect.Use
  91.                         NFS2_CENTREPOS (-1) to centre it on a hires-screen.
  92. NFS2_WindowTitle.l      A pointer on the window-title ended with a zero.Use
  93.                         NFS2_DEFAULTTITLE (0) to use the default window-
  94.                         title.
  95. NFS2_DefaultPath.l      A pointer on a string containing the default path.Use
  96.                         NFS2_NODEFAULT (0) for no default path.
  97. NFS2_DefaultFile.l      A pointer on a string containing the default filename.
  98.                         Use NFS2_NODEFAULT (0) for no default filename.
  99. NFS2_Screenptr.l        The screenpointer.NFS2_ACTIVESCREEN (0)  will force
  100.                         FileSelect to use the active screen.
  101. NFS2_GadgetFlags.w      This flag toggles the three dos-gadgets makedir,
  102.                         delete and rename on/off.Use NFS2_NOGADGETS (0) to
  103.                         switch all off or NFS2_MAKEDIR (1), NFS2_DELETE (2)
  104.                         and NFS2_RENAME (3) to switch them on.Example:
  105.                         NFS2_MAKEDIR!NFS2_DELETE would switch all except
  106.                         Rename on.
  107.                         NFS2_MAKEDIR!NFS2_DELETE!NFS2_RENAME would switch all
  108.                         dos-gadgets on.
  109. NFS2_FirstFilter.l      A pointer on the first structure of the filter list
  110.                         (see below).Use NFS2_NOFILTER (0) to let FileSelect
  111.                         display all files.
  112. NFS2_BackPen.b          The pen which will be used for the background.Use
  113.                         NFS2_DEFAULTPEN (0) to use 1 (white).
  114. NFS2_FilePen.b          The pen for the file-display.Default: 2 (black).
  115. NFS2_DirPen.b           The pen for the directories.Default: 3 (orange).
  116. NFS2_GadgetPen.b        The pen for the gadgets.Default: 2 (black).
  117. NFS2_Reserved1.l        Set it to zero.
  118. NFS2_Reserved2.l        Set it to zero.
  119.  
  120. You can give a list of filters to FileSelect, e.g. that files with that
  121. extension will not be displayed.This can be useful to avoid displaying
  122. .info-, .iff-, .txt-files etc. NFS2_FirstFilter should point on the
  123. following structure:
  124.  
  125. FS2F_FilterElement      rs.b    0
  126. FS2F_NextFilter         rs.l    1
  127. FS2F_FilterLength       rs.b    1
  128. FS2F_AdjustToWord       rs.b    1
  129. FS2F_Filter             rs.l    1
  130. FS2F_Reserved           rs.l    1
  131. FS2F_SIZEOF             rs.w    0
  132.  
  133. FS2F_NextFilter.l       Either a pointer on the next filter-structure or
  134.                         FS2F_LASTFILTER (0) to end the list.
  135. FS2F_FilterLength.b     Length of the string
  136. FS2F_AdjustToWord.b     Only used to align the next longword.
  137. FS2F_Filter.l           A pointer on a string containing the extension.
  138. FS2F_Reserved.l         Set it to zero.
  139.  
  140. If there appears no guru-meditation your program will receive a pointer in
  141. d0 on the following structure:
  142.  
  143. FS2_FileSelectReturn    rs.b    0
  144. FS2_Status              rs.w    1
  145. FS2_Path                rs.l    1
  146. FS2_File                rs.l    1
  147. FS2_FullName            rs.l    1
  148. FS2_Reserved1           rs.l    1
  149. FS2_Reserved2           rs.l    1
  150. FS2_SIZEOF              rs.w    0
  151.  
  152. FS2_Status.w            FS2_OKAY (0) means the user clicked Okay.
  153.                         FS2_CANCEL (1) means the user clicked Cancel.
  154.                         FS2_WINDOWERR (2) means FileSelect was not able to
  155.                         open the window (Probably not enough CHIPMEM).
  156. FS2_Path.l              A pointer on a string containing the path.FS2_NOPATH
  157.                         (0) if there is no path (after CANCEL or WINDOWERR).
  158. FS2_File.l              A pointer on a string containing the filename.
  159.                         FS2_NOFILE (0) if there is no filename (after CANCEL
  160.                         or WINDOWERR).
  161. FS2_FullName.l          A pointer on a string containing the full name
  162.                         (Path + file).FS2_NOFULLNAME (0) if there is no full
  163.                         name (after CANCEL or WINDOWERR).
  164. FS2_Reserved1.l         Normally zero.
  165. FS2_Reserved2.l         Normally zero.
  166.  
  167. FileSelect will use little memory while running, only for its window and 42
  168. bytes per file/dir/device.
  169.  
  170. To include FileSelect in your program you have two possibilities:
  171.  
  172. 1) You can append the source to your source. Then you must delete the
  173.    include-lines and the opt-line.
  174. 2) You can link it to your program with blink.
  175.  
  176. If you use FileSelect V2.0 you must include the file 'FileSelect.i' if you
  177. use some of the keywords like NFS2_ACTIVESCREEN.If you do not link it but
  178. assemble it (with your program) the following files must be included:
  179.  
  180.                 include exec/exec_lib.i
  181.                 include exec/memory.i
  182.                 include intuition/intuition_lib.i
  183.                 include intuition/intuition.i
  184.                 include intuition/intuitionbase.i
  185.                 include graphics/graphics_lib.i
  186.                 include libraries/dos_lib.i
  187.                 include libraries/dos.i
  188.                 include libraries/dosextens.i
  189.  
  190.                 include FileSelect.i
  191.  
  192. If you link the routine your program should import/export the following:
  193.  
  194.                 XREF    FileSelect
  195.                 XDEF    _IntuitionBase,_GfxBase,_DOSBase
  196.  
  197. When you call FileSelect, Intuition.library, Graphics.library and
  198. Dos.library must be open.
  199.  
  200. If you want to use it in any other language than assembler you must do
  201. this on your own because I do not know how compilers treat such include-
  202. files.But I hope that it can easily be linked ! Tips for that can be
  203. expected in the doc-file of the next version.(Send me Tips !)
  204.  
  205. Fell free to change this routine ! If you make major changes please send
  206. me the new versions because I am always interested in improvements.Own
  207. better versions will follow.
  208.  
  209.                         ...AW 29/09/1990...
  210.                      Aragorn/CLUSTER rules !!!
  211.  
  212. -----------------------------------------------------------------------------
  213.  
  214. CLUSTER is a legal programming formation mainly working on Amiga, coding
  215. Freeware (and perhaps some commercial programs later).
  216. CLUSTER was founded on January 1989 with the following members:
  217. André Wichmann, Guido Wegener, Martin Rosenkranz, Martin Baumann, Philipp
  218. Witkop, Stefan Kaspari, Stefan Lietzow and Giang Nguyen.
  219. Then we reduced our members to the best and got a new programmer.
  220. Now, on 29.09.1990, we have the following members:
  221. André Wichmann          Coding
  222. Guido Wegener           Coding
  223. Martin Mohr             Coding
  224. Martin Rosenkranz       Graphics
  225. Philipp Witkop          Digitizing
  226. If you want to contact any member of CLUSTER then write to our address:
  227.              André Wichmann
  228.              Posener Weg 4
  229.              5300 Bonn 1
  230.              West Germany
  231. André will give the letter to the addressed member.
  232.  
  233. Send errors, corrections, supporting ideas, criticism, enthusiastic fan-
  234. letters and money to the author:       André Wichmann
  235.                                        Posener Weg 4
  236.                                        5300 Bonn 1
  237.                                        West Germany
  238.  
  239.